<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            transform-style: preserve-3d;
        }
        .q {
            position: relative;
            width: 300px;
            height: 300px;
            
            
           
            margin: 100px auto;
            
        }
        .box .q div {
            position: absolute;
            top: 0;
            left: 0;
            width: 300px;
            height: 300px;
        }
        .a {
            background-color: black;
            transform: translateZ(150px);
        }
        .b {
            background-color: red;
            transform: translateZ(-150px) rotateY(90deg) translateX(150px);
        }
        .c {
            background-color: yellow;
            transform: translateZ(-150px);
        }
        .d {
            background-color: skyblue;
            transform: translateZ(-150px) rotateY(90deg) translateX(-150px);
        }
        .e {
            background-color: blue;
            transform: translateY(150px) translateZ(-150px) rotateX(90deg);
        }
        .f {
            background-color: pink;
            transform: translateY(-150px) translateZ(-150px) rotateX(90deg);
        }
    </style>
</head>
<body>
    <div class="box">
       <div class="q"> 
       <div class="a"></div>
       <div class="b"></div>
       <div class="c"></div>
       <div class="d"></div>
       <div class="e"></div>
       <div class="f"></div>
    </div>
    </div>
</body>
</html>